﻿using System;
using System.ComponentModel.DataAnnotations;

namespace GameSchool.Models.Common
{
    /// <summary>
    /// Notification er gagnaklasi sem geymir þær upplýsingar sem þarf til að skrá nýja tilkynningu í gagnagrunninn. 
    /// </summary>  

    [Table("gs_notification")]
    public class Notification
    {
        [Key]
        [Column("notification_id")]
        public int NotificationId { get; set; }

        [Column("course_id")]
        public int? CourseId { get; set; } // nullable

        [ForeignKey("CourseId")]
        public virtual Course Course { get; set; } // Virtual, references í course_id

        [Column("title")]
		[Display(Name = "Titill")]
        [Required(ErrorMessage = "Vinsamlegast settu inn titil fyrir tilkynninguna")]
        public string Title { get; set; }

        [Column("notification_message")]
		[Display(Name = "Tilkynning")]
        [Required(ErrorMessage = "Vinsamlegast settu inn texta fyrir tilkynninguna")]
        public string NotificationMessage { get; set; }

        [Column("active")]
        public bool Active { get; set; }

		[Column("entry_by")]
		public int EntryById { get; set; }	

		[Column("entry_date")]
		public DateTime EntryDate { get; set; }

        [ForeignKey("EntryById")]
        public virtual Person Person  { get; set; }
    }
}